#ifndef __LIST_H__
#define __LIST_H__
#include<sys/types.h>
#include<stdlib.h>
#include<string.h>




typedef struct client_msg
{
    /* data */
    char ipv4[64];
    int fd;
    int port;
     /* pointer */
    struct client_msg* Client1;
    struct client_msg* Client2;
    struct client_msg* Next;

}client_list ,*c_list;

c_list list_init(void);
c_list newnode(int fd,int port,char *ip);
int add2list(c_list head,int fd,int port,char *ip);
c_list Del4list(c_list head,int port,char *ip);
int show4list(c_list head);
int show4_chatinglist(c_list head_chating);
c_list find4list(c_list head,int port,char *ip);
c_list Del4_Chatinglist(c_list head_chating,int srcport,char *srcip);
c_list find4_chatinglist(c_list head_chating,int srcport,char *srcip,int tagport,char *tagip);
int add2_Chatinglist(c_list head_connected,c_list head_chating,int srcport,char *srcip,int tagport,char *tagip);
c_list new_groupnode(int groupnum);
c_list find4_grouplist(c_list head_group,int groupnum);
int add2_grouplist(c_list head_group,int groupnum);
c_list find4_groupmember(c_list head_member,int memberport,char *memberip);
int add2_groupmember(c_list head_member,int memberport,char *memberip);
int showgroup(c_list head_group);
int Del4_grouplist(c_list head_group,int memberport,char *memberip);
#endif